//
//  XLPPGuardianTableViewCell.m
//  XiangLove
//
//  Created by 陈宪栋 on 2017/12/20.
//  Copyright © 2017年 BAOMIHUA.COM. All rights reserved.
//

#import "XLPPGuardianTableViewCell.h"

@implementation XLPPGuardianTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = [UIColor clearColor];
        self.contentView.backgroundColor = kWhiteColor;
        [self setupView];
    }
    return self;
}

- (void)setupView {
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    self.separatorInset = UIEdgeInsetsMake(0, 52, 0, 0);
    
    _rankImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:_rankImageView];
    [_rankImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(15);
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(21, 29));
    }];
    
    _rankLabel = [[UILabel alloc] init];
    _rankLabel.font = [UIFont systemFontOfSize:17];
    _rankLabel.textColor = kDarkGrayColor;
    [self.contentView addSubview:_rankLabel];
    [_rankLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(26);
        make.centerY.equalTo(self.contentView.mas_centerY);
    }];
    
    _avatarImageView = [[UIImageView alloc] init];
    _avatarImageView.layer.cornerRadius = 5;
    _avatarImageView.layer.masksToBounds = YES;
    [self.contentView addSubview:_avatarImageView];
    [_avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(48, 48));
        make.left.equalTo(_rankImageView.mas_right).offset(11);
        make.centerY.equalTo(_rankImageView);
    }];
    
    _nickNameLabel = [[UILabel alloc] init];
    _nickNameLabel.font = [UIFont systemFontOfSize:17];
    _nickNameLabel.textColor = kDarkGrayColor;
    [self.contentView addSubview:_nickNameLabel];
    [_nickNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_avatarImageView.mas_right).offset(11);
        make.centerY.equalTo(_avatarImageView);
        make.right.equalTo(self.contentView.mas_right).offset(-100);

    }];
    _goldBeanLabel = [[UILabel alloc] init];
    _goldBeanLabel.textColor = kBlackColor;
    _goldBeanLabel.textAlignment = NSTextAlignmentRight;
    _goldBeanLabel.font = [UIFont systemFontOfSize:15];
    [self.contentView addSubview:_goldBeanLabel];
    [_goldBeanLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView.mas_right).offset(-14);
        make.centerY.equalTo(self.contentView.mas_centerY);
    }];
    
    
}

@end
